Repository navigation
Align settleFilBeamPaymentRails to FilecoinPay v2 - #684
Merged
Merged
Conversation
wjmelements
reviewed
Dec 1, 2026
| } | ||
| ScriptBuilder script = newScript().setToken(token); | ||
| if (cdnAmount > 0) { | ||
| uint64 cdnNonce = CDN_RAIL_NONCE_FLAG | uint64(dataSetId); |
Contributor
There was a problem hiding this comment.
I don't think we need to have CDN_RAIL_NONCE_FLAG because we can use the same nonce for both rails, if we assume filBeamBeneficiaryAddress != payee.
Collaborator
Author
There was a problem hiding this comment.
The flag comes from createRails, which this PR doesn't touch. I'll open the topUpCDNRails PR on top of this one, then a follow-up that drops CDN_RAIL_NONCE_FLAG in createRails, settleCDNRails and topUpCDNRails at once.
wjmelements
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
settleFilBeamPaymentRailsnow also handles FilecoinPayV2 data sets. The storage terms pick the path. FilecoinPayV1 is unchanged. On FilecoinPayV2, one script disburses the amounts from the CDN and cache-miss rail locks.FWSSFilBeamModuletakes_filBeamBeneficiaryAddressin its constructor, because FilecoinPayV2 needs the recipient to address the CDN rail.Part of #669
Open question: should we add an event, e.g.
CDNPaymentRailsSettled(dataSetId, cdnAmount, cacheMissAmount)?